<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>找回密码</title>
    <script src="https://cdn.bootcss.com/jquery/3.3.1/jquery.min.js"></script>
</head>
<body>
    <form action="{:url('doGetback')}" method="post">
        <div>
            <label for="username">用户账号</label>
            <input type="text" name="username" id="username">
        </div>
        <div>
            <label for="code">验证码</label>
            <input type="text" name="code" id="code">
            <button type="button" onclick="sendMobileCode()">发送</button>
        </div>
        <div>
            <label for="new_password">新密码</label>
            <input type="text" name="new_password" id="new_password">
        </div>
        <div>
            <label for="rep_password">确认密码</label>
            <input type="text" name="rep_password" id="rep_password">
        </div>
        <input type="submit" value="提交">
    </form>
    <script>
        function sendMobileCode(){
            var username=$("input#username").val();
            if(!username){
                alert("手机号不能为空");
                return false;
            }
            $.post("{:url('user/sms/sendFindbackCode')}",{"username":username},function(data){
                alert(data.msg);
            });
        }
    </script>
</body>
</html>
